//
//  HCUntreatedCallViewController.m
//  HelloCall
//
//  Created by WangYongpeng on 13-9-21.
//  Copyright (c) 2013年 HC. All rights reserved.
//

#import "HCComOperatingViewController.h"

@implementation HCComOperatingViewController

@synthesize tableView = m_tableView;
@synthesize delegate = m_delegate;

- (void)viewDidLoad
{
    [super viewDidLoad];
	// Do any additional setup after loading the view.
    self.view.backgroundColor = [UIColor clearColor];
    
    //创建列表
    self.tableView = [[[UITableView alloc] initWithFrame:CGRectMake(0, 0, [[UIScreen mainScreen] bounds].size.width, [[UIScreen mainScreen] bounds].size.height - 80)] autorelease];
    [self.view addSubview:self.tableView];
    self.tableView.dataSource = self;
    self.tableView.delegate = self;
    self.tableView.backgroundColor = [UIColor whiteColor];
    
    UIBarButtonItem* menuItem = [[[UIBarButtonItem alloc] initWithTitle:@"菜单" style:UIBarButtonItemStylePlain target:self action:@selector(menuItemPress:)] autorelease];
    self.navigationItem.leftBarButtonItem = menuItem;
    
    m_menuIndex = -1;
}

- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

- (NSArray*)getDataArray
{
    NSArray* array = nil;
        
    return array;
}

- (void)showNextWindow:(UIViewController*)viewController
{
    if ([self.delegate respondsToSelector:@selector(showNextView:)])
    {
        [self.delegate showNextView:viewController];
    }
}

#pragma mark -- UITableViewDataSource
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
    if ([self getDataArray].count > 0)
    {
        if (m_menuIndex > -1)
        {
            return [self getDataArray].count + 1;
        }
        else
        {
            return  [self getDataArray].count;
        }
    }
    else
    {
        return 0;
    }
}

- (UITableViewCell*)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    UITableViewCell* cell = nil;
    return cell;
}

#pragma mark -- UITableViewDelegate
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
    if (m_menuIndex < 0)
    {
        m_menuIndex = indexPath.row + 1;
    }
    else
    {
        m_menuIndex = -1;
    }

    [self.tableView reloadData];
}

@end
